function get_table_content(html_content)
	local start_str = '<table.->'
	local end_str = '</table>'
	local _, i = string.find(html_content, start_str)
	i = i + 1
	local j = string.find(html_content, end_str) - 1
	if i and j then
		return string.sub(html_content, i, j)
	else
		return nil
	end
end

local function find_label(table_content, label)
	local s = 0
	return function ()
		local start_str = '<' .. label .. '.->'
		local end_str = '</' .. label .. '>'
		-- reach end of the content
		if s >= string.len(table_content) then
			return nil
		end

		local _, i = string.find(table_content, start_str, s)
		local j, k = string.find(table_content, end_str, s)

		if i and j then
			i = i + 1
			j = j - 1
			s = k + 1 -- update start point
		else
			return nil
		end

		-- invalid data
		if i > j then
			return nil
		end

		return string.sub(table_content, i, j)
	end
end

-- find all <[lable]></[label]>
function filter_content(table_content, label)
	local tds = {}
	local find_td = find_label(table_content, label)

	repeat
		local data = find_td()
		table.insert(tds, data)
	until data == nil

	return tds
end




